<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <link href="__STATIC__/assets/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
    <link rel="stylesheet" href="__STATIC__/assets/arr_css/bootstrap.min.css">
    <link rel="stylesheet" href="__STATIC__/assets/index_css/head.css">
    <link rel="stylesheet" href="__STATIC__/assets/index_css/footer.css">
    <link href="__STATIC__/layer/layui.css" rel="stylesheet" type="text/css" />
    <link rel="stylesheet" href="__STATIC__/assets/content/experience.css">
    <link rel="stylesheet" href="__STATIC__/layui/css/layui.css">

    <title>分类</title>
    <style>
    </style>

</head>

<body>

    {include file="public/top"}
    <!-- 分类 -->

    <div class="experience_neir">
        {if condition="(empty($selling_list))"}
        <p style="font-size:30px;margin:50% auto;text-align:center;">暂无该品牌信息!
            <br>
            <br>
            <a href="{:url('Class/index')}" style="color:#1ABEF3">
                <-返回</a>
        </p>

        {else /} {volist name="selling_list" id="v"}
        <div class="tiyan">


            <div class="tiyan_dizhi">
                <div>
                    <img style="width: 258px;height: 182px;" src="__STATIC__/assets/images/dizhi.jpg" alt="">
                </div>
                <div style="margin-left: 20px; display: flex;flex-direction: column;">
                    <div class="tiyan_title">
                        <b>{$v.selling_name}</b>
                    </div>
                    <div class="tiyan_dizhi_box">
                        <div>
                            <p>地&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;址：</p>
                            <p style="margin-top: 21px;">抵达路线：</p>
                            <p></p>
                        </div>
                        <div style="width:450px;">
                            <p>{$v.address}</p>
                            <p></p>
                            <p style=" margin-top: 20px;line-height: 24px;">{$v.route}</p>
                        </div>
                    </div>

                </div>

            </div>
            <form action="" id="formData">
                <input type="hidden" name="selling_name" value="{$v.selling_name}">
                <input type="hidden" name="selling_id" value="{$v.selling_id}">
                <div class="layui-form">
                    <div class="layui-inline" style="border-radius: 10px; height: 38px; background: #ececec;">
                        <div class="layui-input-inline">
                            <input style="border-radius: 10px; background: #ececec;border: 0;" type="text" name="time" lay-verify="date" autocomplete="off"
                                placeholder="点此选择到点时间" class="layui-input">
                        </div>
                        <div class="layui-form-item">
                            <div class="layui-input-block">
                                <div class="layui-btn" lay-submit="" lay-filter="demo1" onclick="tijiao()">预约到店</div>
                            </div>
                        </div>
                    </div>

                </div>


            </form>
            <div class="extend">
                <div class="arrow" onclick="brandlist({$v.selling_id},this)">
                    <div class="arrowDown">
                        <span style="margin-right:18px; ">更多品牌</span>
                        <img src="__STATIC__/assets/images/icon_down.png" alt="">
                    </div>
                    <div style="display: none;" class=" arrowUp">
                        <span style="margin-right:18px; ">收起</span>
                        <img src="__STATIC__/assets/images/icon_up.png" alt="">
                    </div>
                </div>

                <div class="band_logo_box zhuangtai" id="brandtop">
                </div>
            </div>

        </div>



        {/volist} {/if}

    </div>



    <!-- 底部 -->
    {include file="public/footer"}

</body>

<script src="__STATIC__/assets/arr_css/jquery-3.3.1.js"></script>
<script type="text/javascript" src="__STATIC__/assets/arr_css/jquery.SuperSlide2.js"></script>
<script src="__STATIC__/assets/arr_css/bootstrap.min.js"></script>
<script src="__STATIC__/assets/arr_css/head.js"></script>
<script src="__STATIC__/layer/layer.js"></script>
<script src="__STATIC__/layui/layui.js"></script>

<script src="__STATIC__/assets/content/experience.js"></script>


<script>
    function brandlist(id, obj) {
        $.ajax({
            type: "POST",
            url: "{:url('Class/brandlist')}",
            data: {
                selling_id: id
            }, // 要提交的表单 
            success: function (data) {
                // console.log(data);
                if (data != 3) {
                    for (var i = 0; i < data.length; i++) {
                        // console.log(data[i].brand_img);
                        $("<div class='band_logo'><img src='__ROOT__/" + data[i].brand_img + "' alt=''><p>" +
                            +"</p></div>").appendTo($(obj).next());
                    }

                    $(obj).next().toggle()
                } else {

                }


            }
        });
    }
    $(".layui-form .layui-input-inline").children("input").hover(function () {
        $(".layui-form .layui-input-inline").children("input").attr("id", " ")
        $(this).attr("id", "date1");
        layui.use('laydate', function () {
            var laydate = layui.laydate;
            //执行一个laydate实例
            laydate.render({
                elem: ('#date1'),
                min: 0,
                // max: 7
            });
        });

    }, function () {
        $(".layui-form .layui-input-inline").children("input").attr("id", " ")

    });



    function tijiao() {
        $.ajax({
            type: "POST",
            url: "{:url('Class/selling_add')}",
            data: $('#formData').serialize(), // 要提交的表单 
            success: function (data) {
                if (data == '1') {
                    //提示层
                    // console.log('1222221');
                    // layer.msg('预约成功', {icon: 1});
                    alert('恭喜您,预约成功');
                } else if (data == '3') {
                    //提示层
                    // layer.msg('预约失败;', {icon: 2});
                    alert('今天您已经预约过了,请不要重复预约!');
                } else if (data == '4') {
                    alert('您还没有登入,请登入后进行预约');
                } else {
                    alert('很抱歉,预约失败');
                }

            }
        });
    }
</script>




</html>